<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>文件下载示例</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
    <script type="text/javascript">
        function downloadFile() {
            fetch('/xmlParse/b', {
                method: 'GET',
                credentials: 'same-origin',
                headers: {
                    'Content-Type': 'application/json'
                }
            })
            .then(response => response.blob())
            .then(blob => {
                saveAs(blob, "patientInfoDtos.xml");
            })
            .catch(error => {
                console.error('发生了错误', error);
            });
        }
    </script>
</head>
<body>
<form action="/xmlParse/a" enctype="multipart/form-data" method="post">
    <input type="file" name="file" id="name">
    <input type="submit" value="Submit">
</form>
<button onclick="downloadFile()">下载文件</button>
</body>
</html>